package utils;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

public class DataSourceUtils {
    private  static DataSource ds=new ComboPooledDataSource();
    public static DataSource getDataSource(){
        return ds;
    }
    public static Connection getConnection()throws SQLException{
        return ds.getConnection();
    }
}
/**
 * 本类用于创建一个数据源对象呢，获取数据源，创建数据源连接池对象
 */
